package org.hzz.api.coupon;

import io.gitee.pkmer.convention.page.PageResponse;
import io.gitee.pkmer.convention.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.hzz.promotions.types.req.UserCouponPageReq;
import org.hzz.promotions.types.vo.UserCouponVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/2
 */
@RequestMapping("/user-coupons")
@Tag(name = "用户领取优惠券")
public interface UserCouponApi {

    @Operation(description = "通过id领取优惠券")
    @PostMapping("/{id}/receive")
    Result<Void> receiveByCouponId(
            @Parameter(description = "优惠券ID")
            @PathVariable String id);

    @Operation(description = "通过兑换码领取优惠券")
    @PostMapping("/{code}/exchange")
    Result<Void> receiveByCouponCode(
            @Parameter(description = "优惠券兑换码")
            @PathVariable String code);

    @Operation(description = "分页查询用户领取优惠券")
    @PostMapping("/page")
    Result<PageResponse<UserCouponVo>> page(
            @RequestBody
            UserCouponPageReq pageReq);
}
